package cn.qin.Interceptors;

import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class checkLogin extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		HttpSession hs = ServletActionContext.getRequest().getSession();
		if(hs.getAttribute("name")!=null)
			return invocation.invoke();
		else return Action.LOGIN;
	}

}
